<?php echo $header; ?>
<div id="content">
  <div class="breadcrumb">
    <?php foreach ($breadcrumbs as $breadcrumb) { ?>
    <?php echo $breadcrumb['separator']; ?><a href="<?php echo $breadcrumb['href']; ?>"><?php echo $breadcrumb['text']; ?></a>
    <?php } ?>
  </div>
  <?php if ($error_warning) { ?>
  <div class="warning"><?php echo $error_warning; ?></div>
  <?php } ?>
  <div class="box">
    <div class="heading">
      <h1><img src="view/image/customer.png" alt="" />网站内容管理</h1>
      <div class="buttons"><a onclick="location = '<?php echo $insert; ?>'" class="button">添加</a><a onclick="$('form').attr('action', '<?php echo $delete; ?>'); $('form').submit();" class="button">删除</a></div>
    </div>
    
    <div class="content">
      <form action="<?php echo $action; ?>" method="post" enctype="multipart/form-data" id="form">
      	<div id="languages">
      	<?php foreach ($languages as $language) { ?>
      		<a href="#language<?php echo $language['language_id']; ?>">
      			<img src="view/image/flags/<?php echo $language['image']; ?>" title="<?php echo $language['name'] ?>" />
      			<?php echo $language['name']; ?>
      		</a>
      	<?php } ?>
      	</div>
      	
      	<?php foreach ($languages as $language ) {
			$language_id = $language['language_id'];
      	?>
      	<div id="language<?php echo $language_id; ?>">
      		<table>
      			<tr>
      				<td>
      					<span class="required">*</span><b>标题：</b><br/>
      					<input type="text" name="page_info[<?php echo $language_id; ?>]['title']" size="100" value="<?php echo isset($page_info[$language_id]) ? $page_info[$language_id]['title'] : ''; ?>" />
      					<?php if(isset($error_title[$language_id])) { ?>
      					<span class="error"><?php echo $error_title[$language_id]; ?></span>
      					<?php } ?>
      				</td>
      			</tr>
      			<tr>
      				<td>
      					<b>Meta描述：</b><br/>
      					<input type="text" name="page_info[<?php echo $language_id; ?>][meta_description]" size="100" value="<?php isset($page_info[$language_id]) ? $page_info[$language_id]['meta_description'] : ''; ?>" />
      				</td>
      			</tr>
      			<tr>
      				<td>
      					<b>Meta关键字：</b><br/>
      					<input type="text" name="page_info[<?php echo $language_id; ?>][meta_keyword]" size="100" value="<?php isset($page_info[$language_id]) ? $page_info[$language_id]['meta_keyword'] : ''; ?>" />
      				</td>
      			</tr>
      			<tr>
      				<td>
      					<b>页面内容：</b>
      					<script type="text/plain" id="page_info[<?php echo $language_id; ?>][content]" name="page_info[<?php echo $language_id; ?>][content]">
							<?php echo isset($page_info[$language_id]) ? $page_info[$language_id]['content'] : '请输入页面内容！'; ?>
						</script>
      				</td>
      			</tr>
      		</table>
      	</div>
      	<?php } ?>
       
      </form>
      
      
    </div>
  </div>
</div>
<link rel="stylesheet" type="text/css" href="view/javascript/ueditor/themes/default/ueditor.css" />
<script type="text/javascript" src="view/javascript/ueditor/editor_config.js"></script>
<script type="text/javascript" src="view/javascript/ueditor/editor_all.js"></script>
<script type="text/javascript">
<!--
<?php foreach($languages as $language) { 
	$language_id = $language['language_id'];
?>
var editor_<?php echo $language_id; ?> = new baidu.editor.ui.Editor();
editor_<?php echo $language_id; ?>.render("page_info[<?php echo $language_id; ?>][content]");
<?php } ?>

//-->
</script>
<?php echo $footer; ?> 